package designmode.creator.singleton;

public class InstanceSingleton {

    /*
    * 单例模式
    * */
    private static InstanceSingleton instance=null;

    private InstanceSingleton(){
    }

    private static synchronized void syncInit() {
        if (instance == null) {
            instance = new InstanceSingleton();
        }
    }

    public static InstanceSingleton getInstance() {
        if (instance == null) {
            syncInit();
        }
        return instance;
    }
}
